package com.yangit.temp.common.entity.result;

import java.io.Serializable;
import java.util.Map;

public class JsonResult<T>	implements Serializable {

	/**
	 * --序列号
	 */
	private static final long serialVersionUID = 1L;




	/**
	 * -返回状态码   是
	 * - 此字段是通信标识，非交易标识，交易是否成功需要查看result_code来判断
	 * 	SUCCESS/FAIL
	 */
	public Code returnCode;
	


	/**
	 * -返回信息	是	
	 * -当return_code为FAIL时返回信息为错误原因 ，例如 
	 * -签名失败,参数格式校验错误
	 */	
	public String returnMsg;

	

	public JsonResult(){
		this.returnCode = Code.SUCCESS;
		this.returnMsg = "OK";
	}
	
	
	
	public JsonResult(String returnMsg){
		this.returnCode = Code.FAIL;
		this.returnMsg = returnMsg;
	}
	
	
	public Code getReturnCode() {
		return returnCode;
	}



	public void setReturnCode(Code returnCode) {
		this.returnCode = returnCode;
	}



	public String getReturnMsg() {
		return returnMsg;
	}



	public void setReturnMsg(String returnMsg) {
		this.returnMsg = returnMsg;
	}



	@Override
	public String toString() {
		return "JsonResult [returnCode=" + returnCode + ", returnMsg=" + returnMsg + "]";
	}



	public static JsonResult ok(String string) {
		
		return null;
	}
	public static JsonResult ok(Map map) {
		
		return new TradeResult<Map>(map);
	}



	public static JsonResult error(String string) {
		return null;
	}
	
	
}
